<?php
	header("content-type:text/html;charset=utf8");
	$pdo = new PDO('mysql:host=127.0.0.1;dbname=kycp;charset=utf8','root','root');
	$sql = "select * from ceshi";
	$data = $pdo->query($sql)->fetchAll();
	echo "<pre/>";
// print_r($data);
?>
<!DOCTYPE html>
<html>
<head>
	<title>用户展示</title>
</head>
<body>
          <center>
          	 <table>
          	 	<tr>
          	 	    <td>姓名</td>
          	 	    <td>年龄</td>
          	 	    <td>性别</td>
          	 	    <td>手机</td>
          	 	    <td>入库时间</td>
          	 	</tr>
          	 	<?php foreach ($data as $key => $v):?>
          	 	<tr>
          	 		<td><?=$v['name']?></td>
          	 	    <td><?=$v['age']?></td>
          	 	    <td><?=$v['sex']?></td>
          	 	    <td><?=$v['phone']?></td>
          	 	    <td><?=date('Y-m-d',$v['add_time'])?></td>
          	 	    <td><a href="delete.php?id=<?=$v['id']?>">删除</a></td>
          	 	    <td><a href="update.php?id=<?=$v['id']?>">修改</a></td>
          	 	</tr>
          	 <?php endforeach;?>
          	 </table>
          </center>
</body>
</html>